package tq.com.tqteacher.view;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;

import tq.com.tqteacher.R;

public class TQChoiceFileView extends FrameLayout {

    public TQChoiceFileView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initUI();
    }

    private void initUI(){
        LayoutInflater.from(getContext()).inflate(R.layout.view_choice_file_layout, this);

        findViewById(R.id.upload_icon).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if(mCallback != null) mCallback.finishChoice();
            }
        });
    }


    private Callback mCallback;
    public void setFinishCall(Callback c){
        mCallback = c;
    }

    public interface Callback{
        void finishChoice();
    }
}
